package com.jt.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@PropertySource(value = "classpath:/dept.properties",encoding = "utf-8")
@Data
@Accessors(chain = true)
@NoArgsConstructor //无参
@AllArgsConstructor//全参
public class Dept {
    private Integer id;
    private String name;
    @Value("${dept.id2}")
    private Integer id2;
    @Value("${dept.name2}")
    private String name2;

    @Override
    public String toString() {
        return "Dept{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", id2=" + id2 +
                ", name2='" + name2 + '\'' +
                '}';
    }
}
